package com.xyht.sca_s.student_manage_system.modules.dormitory.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.dormitory.entity.req.SmsWnsChargeClassificationRelationBindReq;
import com.xyht.sca_s.student_manage_system.modules.dormitory.entity.req.SmsWnsChargeClassificationRelationUnbindReq;
import com.xyht.sca_s.student_manage_system.modules.dormitory.service.SmsWnsChargeClassificationRelationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 收费标准和分类关联表(--迎新) 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2024-01-18
 */
@RestController
@RequestMapping("/dormitory/chargeClassificationRelation")
@SecretBody
public class SmsWnsChargeClassificationRelationController {


    @Resource
    private SmsWnsChargeClassificationRelationService chargeClassificationRelationService;

    @ApiOperation("绑定费用")
    @PostMapping("/bind")
    public ResponseResult bindCharge(@RequestBody SmsWnsChargeClassificationRelationBindReq bindReq){
        return chargeClassificationRelationService.bindCharge(bindReq);
    }

    @ApiOperation("解绑费用")
    @PostMapping("/unbind")
    public ResponseResult unbindCharge(@RequestBody SmsWnsChargeClassificationRelationUnbindReq unbindReq){
        return chargeClassificationRelationService.unbindCharge(unbindReq);
    }

    @ApiOperation("绑定列表")
    @GetMapping("/list")
    public ResponseResult getBindChargeList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                            @RequestParam(value = "type") Integer type){
        return chargeClassificationRelationService.getBindChargeList(pageNum,pageSize,type);
    }
}

